<!doctype html>
<html>

<head>
    <title>Neovis.js Simple Example</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <style type="text/css">
        html,
        body {
            font: 16pt arial;
        }

        #viz {
            width: 1000px;
            height: 900px;
            border: 10px solid lightgray;
            font: 22pt arial;
        }
    </style>

    <!-- FIXME: load from dist -->
    <script type="text/javascript" src="js\neovis.js"></script>
    <script src="js\jquery.min.js"></script>

    <script type="text/javascript">
        // define config car
        // instantiate nodevis object
        // draw

        var viz;

        function draw() {
            var config = {
                //
                container_id: "viz",
                server_url: "bolt://localhost:7687",
                server_user: "neo4j",
                server_password: "123",
                labels: {
                    // "Character": "name",
                    "Character": {
                        "caption": "name", // 节点下面显示的

                        "size": "pagerank", // 节点的大小根据pagerank决定
                        "community": "community" // 根据community决定颜色
                        // "sizeCypher": "MATCH (n) WHERE id(n) = {id} MATCH (n)-[r]-() RETURN sum(r.weight) AS c"
                    }
                },
                relationships: {
                    "INTERACTS": {
                        "thickness": "weight", // thickness厚度 关系厚度由weight属性决定
                        "caption": true // 不显示关系标题
                    }
                },
                initial_cypher: "MATCH p=()-[r:INTERACTS]->() RETURN p LIMIT 25" // 初始化
            };

            viz = new NeoVis.default(config);
            viz.render();
            console.log(viz);

        }
    </script>
    <script src="js\index.js"></script>

</head>

<body onload="draw()">
<div id="viz"></div>

Cypher 查询语句: <textarea rows="4" cols=50 id="cypher"></textarea><br>
<input type="submit" value="提交" id="reload">
<input type="submit" value="固定" id="stabilize">

</body>


</html>